# -*- coding: utf-8 -*-
# from django.db import models

# Create your models here.
import uuid
from datetime import datetime

from django.db import models


class Script(models.Model):
    id = models.CharField(db_column='id', primary_key=True, default=uuid.uuid4, editable=False, max_length=36)
    name = models.CharField(db_column='name', null=True, max_length=64)
    content = models.TextField(db_column='content', null=True)
    argument = models.CharField(db_column='argument', max_length=64, null=True)
    desc = models.TextField(db_column='desc', null=True)

    class Meta:
        db_table = 'tbl_script'


class User(models.Model):
    id = models.CharField(db_column='id', primary_key=True, default=uuid.uuid4, editable=False, max_length=36)
    delflag = models.BooleanField(db_column='delflag', default=False)
    created = models.DateTimeField(db_column='created', default=datetime.now, blank=True)
    updated = models.DateTimeField(db_column='updated', auto_now=True, blank=True)
    creator = models.CharField(db_column='creator', max_length=64, blank=True, null=True)
    modifier = models.CharField(db_column='modifier', max_length=64, blank=True, null=True)
    bk_user_id = models.BigIntegerField(verbose_name='用户Id', null=True, blank=True)
    bk_username = models.CharField(max_length=128, null=True, blank=True)
    bk_display_name = models.CharField(max_length=256, verbose_name='用户手机号', null=True, blank=True)
    bk_user_mobile = models.CharField(max_length=256, verbose_name='用户手机号', null=True, blank=True)
    bk_user_email = models.CharField(max_length=256, verbose_name='BK用户邮箱', null=True, blank=True)
    logo_url = models.TextField(null=True, verbose_name='BK用户LOGO', blank=True)
    bk_user_status = models.CharField(max_length=64, verbose_name='蓝鲸用户状态:NORMAL,DELETED,DISABLED', null=True,
                                      blank=True)
    bk_user_enabled = models.SmallIntegerField(verbose_name='蓝鲸用户启用状态,0:已删除,1:已启用', null=True, blank=True)
    user_type = models.SmallIntegerField(verbose_name='用户类型,1:平台运营方,2:教育主管部门,3:应用服务商,4:教育单位', null=True, blank=True)
    org_sn = models.CharField(max_length=36, null=True, blank=True, default='')
    org_name = models.CharField(max_length=36, null=True, blank=True, default='')
    update_flag = models.BooleanField(default=True)

    class Meta:
        db_table = 'tbl_user'
